<template>
  <div class="webinfo-wrap">
    <div v-if="routeName == 'webInformation'">
      <el-tabs v-model="activeName">
        <el-tab-pane label="网站基本信息" name="1"></el-tab-pane>
        <el-tab-pane label="页面配置" name="7"></el-tab-pane>
        <el-tab-pane label="系统配置" name="5"></el-tab-pane>
        <el-tab-pane label="友情链接" name="2"></el-tab-pane>
        <el-tab-pane label="意见反馈" name="3"></el-tab-pane>
        <el-tab-pane label="我要纠错" name="4"></el-tab-pane>
        <!-- <el-tab-pane label="积分规则" name="6"></el-tab-pane> -->
      </el-tabs>
      <div v-if="activeName == 1">
        <List :flag="flag" />
        <Add :flag="flag" />
      </div>
      <div v-if="activeName == 7">
        <HomeConfig />
      </div>
      <div v-if="activeName == 2">
        <FrientLink />
      </div>
      <div v-if="activeName == 3">
        <Feedback />
      </div>
      <div v-if="activeName == 4">
        <Correction />
      </div>
      <div v-if="activeName == 5">
        <BasicConfig />
      </div>
      <!-- <div v-if="activeName == 6">
        <ScoreManage />
      </div> -->
    </div>
    <div v-else>
      <List :flag="flag" />
      <Add :flag="flag" />
    </div>
  </div>
</template>
<script>
export default {
  components: {
    List: () => import('./List.vue'),
    Add: () => import('./Add.vue'),
    FrientLink: () => import('../friendLink'),
    Feedback: () => import('../feedback'),
    Correction: () => import('../correction'),
    BasicConfig: () => import('../config/basicConfig.vue'),
    // ScoreManage: () => import('../scoreManage/index.vue'),
    HomeConfig: () => import('../homeConfig/index.vue'),
  },
  data() {
    return {
      flag: this.$store.state.userInfo.userInfo.id == -1, //开发者权限
      activeName: '1',
      routeName: '',
    }
  },
  watch: {
    $route(v) {
      this.activeName = '1'
      this.routeName = v.name
    },
  },
  mounted() {
    this.routeName = this.$route.name
  },
}
</script>
<style scoped>
.webinfo-wrap {
  max-height: calc(100vh - 200px);
  overflow-x: hidden;
  overflow-y: auto;
}
</style>